﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp
{
    public partial class Form3 : Form
    {
        public Form3()
        {
            InitializeComponent();
        }


        /// <summary>
        /// 判断是否为空
        /// </summary>
        /// <param name="controls"></param>
        /// <returns></returns>
        public bool IsNullOrEmpty(ControlCollection controls) {
            bool flag = false;
            foreach (Control item in controls)
            {
                if (string.IsNullOrEmpty(item.Text))
                {
                    flag = true;
                }
            }
            return flag;
        }
        private void label3_Click(object sender, EventArgs e)
        {

        }

        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {

        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        private void label5_Click(object sender, EventArgs e)
        {

        }

        private void checkBox3_CheckedChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            bool flag = IsNullOrEmpty((ControlCollection)this.Controls);
            if (flag)
            {
                MessageBox.Show("请填写全部信息!");
            }
            else
            {
                MessageBox.Show("注册成功");
            }
        }
    }
}
